package com.heiye.kv.api.api;

import com.heiye.kv.api.dto.req.*;
import com.heiye.kv.api.constant.ApiConstants;
import com.heiye.framework.common.response.Response;
import com.heiye.kv.api.dto.rsp.DeleteCommentContentReqDTO;
import com.heiye.kv.api.dto.rsp.FindCommentContentRspDTO;
import com.heiye.kv.api.dto.rsp.FindQuizContentRspDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: heiye
 * @date: 2025/03/13 上午11:22
 * @version: v1.0.0
 * @description: K-V 键值存储 Feign 接口
 */
@FeignClient(name = ApiConstants.SERVICE_NAME)
public interface KeyValueFeignApi {

    String PREFIX = "/kv";

    @PostMapping(value = PREFIX + "/quiz/content/add")
    Response<?> addQuizContent(@RequestBody @Validated AddQuizContentReqDTO addQuizContentReqDTO);

    @PostMapping(value = PREFIX + "/quiz/content/find")
    Response<FindQuizContentRspDTO> findQuizContent(@RequestBody @Validated FindQuizContentReqDTO findQuizContentReqDTO);

    @PostMapping(value = PREFIX + "/quiz/content/delete")
    Response<?> deleteQuizContent(@RequestBody @Validated DeleteQuizContentReqDTO deleteQuizContentReqDTO);

    @PostMapping(value = PREFIX + "/comment/content/batchAdd")
    Response<?> batchAddCommentContent(@RequestBody BatchAddCommentContentReqDTO batchAddCommentContentReqDTO);

    @PostMapping(value = PREFIX + "/comment/content/batchFind")
    Response<List<FindCommentContentRspDTO>> batchFindCommentContent(@RequestBody BatchFindCommentContentReqDTO batchFindCommentContentReqDTO);

    @PostMapping(value = PREFIX + "/comment/content/delete")
    Response<?> deleteCommentContent(@RequestBody DeleteCommentContentReqDTO deleteCommentContentReqDTO);

    @PostMapping(value = PREFIX + "/comment/content/batchDelete")
    Response<?> batchDeleteCommentContent(@Validated @RequestBody BatchDeleteCommentContentReqDTO batchDeleteCommentContentReqDTO);
}
